package com.example.dubboconsumer.controller;

import com.example.dubboapi.service.UserService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {

    @DubboReference
    private UserService userService;

    @GetMapping("/user/info")
    public String getUserInfo(@RequestParam Long userId) {
        return userService.getUserInfo(userId);
    }

    @GetMapping("/hello")
    public String sayHello(@RequestParam String name) {
        return userService.sayHello(name);
    }
}